package com.medical.interrogation.service.impl;

import com.medical.common.security.utils.SecurityUtils;
import com.medical.interrogation.domain.DiagnosticRecord;
import com.medical.interrogation.mapper.DiagnosticRecordMapper;
import com.medical.interrogation.service.DiagnosticRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DiagnosticRecordServiceImpl implements DiagnosticRecordService {

    @Autowired
    private DiagnosticRecordMapper diagnosticRecordMapper;


    /**
     * 诊断记录表添加
     * @param diagnosticRecord
     * @return
     */
    @Override
    public Integer diagnosticInsert(DiagnosticRecord diagnosticRecord) {
        Long userId = SecurityUtils.getUserId();
        diagnosticRecord.setPatientId(userId);
        Integer insert = diagnosticRecordMapper.diagnosticInsert(diagnosticRecord);
        return insert;
    }
}
